import request from '@/router/axios';

// 列表
export const getList = (current, size, params) => {
  return request({
    url: '/api/riskIdentification/jhariskanalysis/page',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

// 详情
export const getDetail = (id) => {
  return request({
    url: '/api/riskIdentification/jhariskanalysis/detail',
    method: 'get',
    params: {
      id
    }
  })
}

// 删除
export const remove = (ids) => {
  return request({
    url: '/api/riskIdentification/jhariskanalysis/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

// 新增
export const add = (row) => {
  return request({
    url: '/api/riskIdentification/jhariskanalysis/save',
    method: 'post',
    data: row
  })
}

// 编辑
export const update = (row) => {
  return request({
    url: '/api/riskIdentification/jhariskanalysis/update',
    method: 'post',
    data: row
  })
}

// 获取所属部门
export const getDeptList = (tenantId) => { 
  return request({
    url: '/api/blade-system/dept/tree',
    method: 'get',
    params: {
      tenantId
    }
  })
}

// 获取可能性列表
export const getPossibilities = () => { 
  return request({
    url: '/api/blade-system/dict-biz/dictionary?code=jha_risk_probability',
    method: 'get'
  })
}

// 获取严重度标准列表
export const getSeverityList = () => {
  return request({
    url: '/api/riskIdentification/riskseverity/all',
    method: 'get'
  })
}

// 删除风险活动
export const removeRiskActivity = (ids) => {
  return request({
    url: '/api/riskIdentification/jhariskactivity/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}